All Questions
17 questions
4votes
3answers
803views
FIFO array/queue
I'm new to programming and was tasked with programming a generic circular FIFO queue, without using anything but an underlying array and self-programmed methods. I still don't know how to approach ...
5votes
2answers
2kviews
User input happy birthday program
For self-study homework I made a Java program that takes user input, creates people as objects, and says "Happy Birthday" to each person. I am just wondering what mistakes I made here or how it could ...
5votes
1answer
3kviews
Counting the number of unique fractions read from a text file
I will begin this question with the disclaimer that it is homework but my code is written and working, I just want to know if there any ways in which I can improve what I already have. I want my ...
1vote
1answer
874views
Integer sum program
This is a little assignment I am working on. I am a beginner Java programmer and would love some advice on how to improve this code. For more context, here are the assignment details: Create a ...
6votes
3answers
912views
Loading tab-separated tweet data into an array
I'm working on this school project and was wondering if there was any way of storing this information better, faster, more professionally. I'm also restricted to only using an array; don't ask me we ...
4votes
1answer
1kviews
Displaying a randomly sized array as a table
This program creates an integer array with a random size of 5-50 elements (inclusive). It then fills the array with random numbers between 0 - 100 (inclusive). The interesting part comes when I then ...
3votes
3answers
2kviews
State flowers and birds
This runs as is, but I'm looking for an alternative way to write it. ...
6votes
2answers
1kviews
2D array to draw a letter 'F'
This is my code to print letter 'F' with nested loop 2d array. Are there changes that could be made in it to make it look better or more efficient? ...
3votes
4answers
2kviews
Concatenate two arrays generated randomly
I have written the code to concatenate two arrays . Please let me know of any loopholes in the written code. ...
8votes
2answers
3kviews
Finding the longest Collatz sequence cycle
I wrote a program to calculate Collatz sequences for initial numbers between 1 and a given integer i, then find the one with the largest cycle length. My code is ...
4votes
3answers
2kviews
Sorting strings in a one dimensional array
What are the better solutions possible? I have a character array with different strings. There is a max size for the strings. In case a string is smaller than max size remaining places are filled ...
5votes
1answer
4kviews
How is my quarterly sales statistics program?
Am I making good use of a 2-D array? Is this code inefficient? I am supposed to receive input from 6 departments for 4 quarterly periods in Java. My assignment asks: Quarterly Sales Statistics ...
6votes
5answers
64kviews
Book program with arrayList
I have this Book program that contains 2 classes: Book and Library. I have the Book class done, but need some help on the ...
2votes
1answer
218views
High School Java Class: Pong Project External Reviewer
It would be a huge help if you could tell me ways to make my code run smoother and if I could add more code to my program to make my program more unique. Panelball class: ...
5votes
3answers
1kviews
Printing a 2D array
The problem presented to me: Declare a two-dimensional array of ints in main. Write a method to read in the size of each dimension, allocate memory for the array and return it (DON'T DO THIS IN MAIN,...